import React, {FC} from 'react';
import "./index.less";
import * as API from "@/services";
import classNames from "classnames";

interface SysMsgItemProps {
  item: API.NotifyRemind;
  onClick?: ( item: API.NotifyRemind)=>void;
}

const SysMsgItem: FC<SysMsgItemProps> = (props) => {
  const {item ,onClick} = props;
  return (
    <div
      className={classNames("msg-item-container", {
      "msg-item-read": item.status === "READ"
    })}
      onClick={(e) => {
        e.preventDefault();
        onClick?.(item)
      }}
    >
      <div className={"msg-item-time"}>{item.createTime}</div>
      <div className={"msg-item-body"}>
        <div className={"msg-item-title"}>{item.action}</div>
        <div className={"msg-item-content"}>{item.message}</div>
      </div>
    </div>
  );
};

export default SysMsgItem;
